#ifndef DATABASEMANAGER_H
#define DATABASEMANAGER_H

#include <TreeItem_Book.h>

#include <QtCore/QList>
#include <QtGui/QTreeWidgetItem>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlRecord>

namespace Jonathan
{

   class DataBaseManager
   {
   public:
      static DataBaseManager* GetInstance       ();
      TreeItem_Book* AddBook                    (QString dbPath, QTreeWidget* bookTree, QTreeWidget* referenceTree);
      QSqlDatabase GetDatabase                  (QString dbPath);
      QList<TreeItem_Book*> GetBooks            ();
      QList<TreeItem_Book*> GetReferenceBooks   ();

   private:
      static Jonathan::DataBaseManager*         s_Instance;
      DataBaseManager                           () { }
      QList<TreeItem_Book*>                     m_Books;
      QList<TreeItem_Book*>                     m_ReferenceBooks;
   };

}

#endif // DATABASEMANAGER_H
